import Eureca from 'eureca.io'
var eurecaServer = new Eureca.Server({allow:['clientEcho']});

//functions under exports namespace become callable from client side
eurecaServer.exports.serverEcho = function(msg) {
  console.log('Server received : ', msg);
}
eurecaServer.exports.helloServer = function(msg) {
  console.log('Server received : ', msg);
}

//each time a client is connected we call
eurecaServer.onConnect(function(socket) {
  var client = socket.clientProxy; //get remote client ref

  //call remote clientEcho function
  // client.clientEcho('Hello from server');
})

export default eurecaServer
